//Implementation
#include<stack>
#include "Deck.h"

//private
	//deck


//Constructor////////////////////////////////////////////////////////////////////////////////////
Deck :: Deck()
{
	shuffle();

}
//Method to draw a card//////////////////////////////////////////////////////////////////////////
Card Deck::draw()
{
	Card temp;
	temp = deck.top();
	deck.pop();

	return temp;
}

//Method to shuffle the deck//////////////////////////////////////////////////////////////////////
void Deck::shuffle()
{
	Card card[52];
	int count = 0;
	
	
	

	//load the array with values and suits
	for(int suit = 0; suit < 4; suit++)
	{
		for(int val = 0; val < 13; val++)
		{
			card[val * 4 + suit].setSuit(suit);
			card[count].setVal(val+ 2);
			
			count++;

		}
	}
	//shuffle the array randomly

	Card temp;
	int a;
	int b;
	for(int j = 0; j < 10000; j++)
	{
		a = rand()%52;
		b = rand()%52;
		temp = card[a];
		card[a] = card[b];
		card[b] = temp;
	}
		

		



	for(int i =0; i < 52; i++)
	{
		deck.push(card[i]);
	}
	
}

void Deck::look()
{
     cout<<deck.top();
}




